/**
 * 
 */
package com.taobao.snowsnow.hibernate.service.impl;

import java.util.List;

import com.taobao.snowsnow.hibernate.dao.BowParamDao;
import com.taobao.snowsnow.hibernate.pojo.BowParam;
import com.taobao.snowsnow.hibernate.pojo.ProductCollect;
import com.taobao.snowsnow.hibernate.service.BowParamService;

/**
 * @author Tux
 *
 * 创建时间: 2011-4-29 上午09:55:17
 */
public class BowParamServiceImpl extends BaseServiceImpl implements BowParamService {
	private BowParamDao bdao1;
	
	public List<BowParam> findAll() throws Exception {
		try {
			return bdao1.findAll();
		} catch(Exception e) {
			e.printStackTrace();
			throw e;
		}
	}

	public BowParam findById(int id) throws Exception {
		try {
			return bdao1.findById(id);
		} catch (Exception e) {
			e.printStackTrace();
			System.out.println("Error at findById(int id)");
			throw e;
		}
	}
	
	public List<BowParam> findByName(String name) throws Exception {
		try {
			return bdao1.findByName(name);
		}  catch (Exception e) {
			e.printStackTrace();
			System.out.println("Error at findByName(String name)");
			throw e;
		}
	}

	public long getTotal() throws Exception  {
		try {
			return bdao1.getTotal();
		}  catch (Exception e) {
			e.printStackTrace();
			System.out.println("Error at getTotal()");
			throw e;
		}
	}

	public List<BowParam> paging(int page, int limit) throws Exception  {
		try {
			return bdao1.paging(page, limit);
		}  catch (Exception e) {
			e.printStackTrace();
			System.out.println("Error at paging(int page, int limit)");
			throw e;
		}
	}

	public void setBdao1(BowParamDao edao) {
		this.bdao1 = edao;
	}

	public BowParamDao getBdao1() {
		return bdao1;
	}

	@Override
	public BowParam getFirstObject() throws Exception {
		try {
			return bdao1.getFirstObject();
		} catch (Exception e) {
			e.printStackTrace();
			System.out.println("BowParam getFirstObject()");
			throw e;
		}
	}

	@Override
	public BowParam getLastObject() throws Exception {
		try {
			return bdao1.getLastObject();
		} catch(Exception e) {
			e.printStackTrace();
			System.out.println("BowParam getLastObject()");
			throw e;
		}
	}

	@Override
	public BowParam findByNamePrecise(String name) throws Exception {
		try {
			return bdao1.findByNamePrecise(name);
		} catch (Exception e) {
			e.printStackTrace();
			System.out.println("BowParam getLastObject()");
			throw e;
		}
	}

	@Override
	public List<BowParam> findByProductCollect(ProductCollect productCollect)
			throws Exception {
		try {
			return bdao1.findByProductCollect(productCollect);
		} catch (Exception e) {
			e.printStackTrace();
			System.out.println("BowParam findByProductCollect()");
			throw e;
		}
	}
}
